<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>添加点击事件</title>
		<script type="text/javascript" src="../js/angular.min.js" ></script>
	</head>
	<body>
		<div ng-app="myapp" ng-controller="myctrl">
			<div>
				<input type="text" name="name" ng-model="name" />
				<input type="button" value="清空" ng-click="clearAll()" /> <!--//添加点击事件-->
			</div>
			<div>
				hello:{{name}}
			</div>
		</div>
		<script type="text/javascript">
			//初始化myapp
			var app = angular.module('myapp', []);
			//依赖注入     $scope作用域
			app.controller("myctrl",["$scope" , function($scope){
				//赋值
				$scope.name="传智播客";
				
				$scope.clearAll=function(){
					$scope.name="";
				}
			}]);
			
		</script>
	</body>
</html>
